#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QCamera>
#include <QCameraViewfinder>
#include <QVideoProbe>
#include <QVideoFrame>
#include <QAbstractVideoSurface>

#include <QMediaService>
#include <QMediaRecorder>
#include <QCameraViewfinder>
#include <QCameraInfo>
#include <QMediaMetaData>

#include <QPainter>
#include <QImage>
#include <QMutex>

#include <QPixelFormat>

#include "videosurface.h"

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

private:
    QCamera *camera;
    QCameraViewfinder *viewfinder;
    QVideoProbe *videoProbe;
    QImage *img;
    QMutex lock;
    videoSurface *videoSurfaceFiter;
    QVideoWidget *videoWidget;

private slots:
    void receiver(const QVideoFrame &frame);

protected:
    void paintEvent(QPaintEvent *event);
};

#endif // MAINWINDOW_H
